<p>When an alternation contains multiple alternatives that consist of a single character, it can be rewritten as a character class. This should be
preferred because it is more efficient and can even help prevent stack overflows when used inside a repetition (see rule {rule:java:S5998}).</p>
<h2>Noncompliant Code Example</h2>
<pre>
Pattern.compile("a|b|c"); // Noncompliant
</pre>
<h2>Compliant Solution</h2>
<pre>
Pattern.compile("[abc]");
// or
Pattern.compile("[a-c]");
</pre>

